#pragma once
#include "widgets.h"

#include <QLineEdit>
class S_WIDGETS_EXPORT SLineEdit : public QLineEdit
{
	Q_OBJECT
public:
	SLineEdit(const QString& ,QWidget* parent = nullptr);
	~SLineEdit() = default;

	bool selectAllWhenFocus() const { return m_selectAllWhenFocus; }
	void setSelectAllWhenFocus(bool val) { m_selectAllWhenFocus = val; }

protected:
	virtual void focusInEvent(QFocusEvent*) override;
	virtual void mousePressEvent(QMouseEvent*) override;

private:
	bool	m_selectAllWhenFocus = false;
};